﻿using University.Workshop.Presenters;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using University.Workshop.Model;

namespace University.Workshop.Tests
{
    
    
    /// <summary>
    ///This is a test class for PresenterReportSaleTest and is intended
    ///to contain all PresenterReportSaleTest Unit Tests
    ///</summary>
    [TestClass()]
    public class PresenterReportSaleTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for GenerateReport
        ///</summary>
        [TestMethod()]
        public void GenerateReportTest()
        {
            ReportSaleProductMock view = new ReportSaleProductMock();
            PresenterReportSale target =new PresenterReportSale(view);
            view.SearchTrue();
            string expected = "ReporteDeVentas.pdf"; 
            string actual;
            actual = target.GenerateReport();
            Assert.AreEqual(expected, actual);
           
        }

        /// <summary>
        ///A test for ReportState
        ///</summary>
        [TestMethod()]
        public void ReportStateTest()
        {
            ReportSaleProductMock view = new ReportSaleProductMock();
            PresenterReportSale target = new PresenterReportSale(view);
            view.ReportState();
            bool expected = true;
            bool actual;
            actual = target.ReportState();
            Assert.AreEqual(expected, actual);
           
        }

        /// <summary>
        ///A test for SearchReport
        ///</summary>
        [TestMethod()]
        public void SearchReportTest()
        {
            ReportSaleProductMock view = new ReportSaleProductMock();
            PresenterReportSale target = new PresenterReportSale(view);
            view.SearchReport();
            bool expected = true;
            bool actual;
            actual = target.SearchReport();
            Assert.AreEqual(expected, actual);

        }

        /// <summary>
        ///A test for SearchReport
        ///</summary>
        [TestMethod()]
        [ExpectedException(typeof(BusinessException))]
        public void SearchReportFailDateTest()
        {
            ReportSaleProductMock view = new ReportSaleProductMock();
            PresenterReportSale target = new PresenterReportSale(view);
            view.SearchReportFailDate();
            bool actual;
            actual = target.SearchReport();


        }

        /// <summary>
        ///A test for SetClient
        ///</summary>
        [TestMethod()]
        public void SetClientTest()
        {
            ReportSaleProductMock view = new ReportSaleProductMock();
            PresenterReportSale target = new PresenterReportSale(view);
            view.SetClient();
            bool expected = true;
            bool actual;
            actual = target.SetClient();
            Assert.AreEqual(expected, actual);
           
        }

        /// <summary>
        ///A test for SetProduct
        ///</summary>
        [TestMethod()]
        public void SetProductTest()
        {
            ReportSaleProductMock view = new ReportSaleProductMock();
            PresenterReportSale target = new PresenterReportSale(view);
            view.SetProduct();
            bool expected = true;
            bool actual;
            actual = target.SetProduct();
            Assert.AreEqual(expected, actual);
           
        }
    }
}
